package de.tum.wi.som.rcpsp.util;

import java.util.ArrayList;
import java.util.List;

public class ArraysUtil {
	
	public static int[] multiplyArrays(Integer[] resource, Integer[] blockLength) {
		int[] result = new int[resource.length*blockLength.length];
		int value=0;
		for (int i = 0; i < resource.length; i++) {
			for (int j = 0; j < blockLength.length; j++) {
				result[value] = resource[i]*blockLength[j];
				value++;
			}
		}
		return result;
	}

	public static Integer[] createArray(int min, int max) {
		Integer[] arr = new Integer[max - min + 1];
		for (int i = 0; i < max - min + 1; i++) {
			arr[i] = min + i;
		}
		return arr;
	}

	public static List<Integer> createArrayList(int min, int max) {
		List<Integer> list = new ArrayList<Integer>();
		for (int i = 0; i < max - min + 1; i++) {
			list.add(min+i);
		}
		return list;
	}

}
